// OUTDOOR SECTION SCRIPT
//    Section: X = 0, Y = 0

// This is the special encounter script for this town.
// The states INIT_STATE and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

beginoutdoorscript;

variables;

body;

beginstate INIT_STATE;
// This state called whenever this section is loaded into memory.
break;

beginstate START_STATE;
// This state is called every turn the party is in this outdoor section. 
break;

beginstate 10; //Entrance message
	if(get_flag(100,0) == 0) {
		reset_dialog();
		add_dialog_str(0,"Now that you are in the Valley proper, you appreciate the beauty of the place even more. Everything looks stunning...",0);
		add_dialog_str(1,"From this vantage point you can see rolling green hills, a sparkling, frothy river pouring down onto a still blue lake, and fields upon fields of lilacs. The sun is still shining strongly too, and the sky is cloudless.",0);
		add_dialog_str(2,"You feel slightly guilty for thinking this way, but you are glad that the girl went missing... if she hadn't, you might never have visited this beautiful place.",0);
		add_dialog_str(3,"You should probably head towards the Valley's first city - Greenleaf. Looking around, it appears to be towards the east. The nearby sign should also offer directions to it.",0);
		run_dialog(1);
		set_flag(100,0,1);
	}
break;

//Secret path to portal
beginstate 11;
	if(get_flag(100,1) == 1) {
		end();
	} else {
		block_entry(1);
	}
break;

//Leaving scen
beginstate 12;
	reset_dialog();
	add_dialog_str(0,"This pass leads out of Twilight Valley. Far away in the distance, you can make out the province's capital, and beyond that the glittering ocean. It would only be a few days walk to there.",0);
	add_dialog_str(1,"That is, if you want to go. You haven't discovered the whereabouts of the Mayor's daughter yet, or why she disappeared. Still, if you wish to leave, it is your choice. Do you?",0);
	add_dialog_choice(0,"I want to leave.");
	add_dialog_choice(1,"I want to stay.");
	if(run_dialog(1) == 1) {
		message_dialog("You leave the Vale, and its secrets, to somebody else. As far as you hear, the young lady is never found. You probably did the right thing, though, in the end.","");
		end_scenario(0);
	} else {
		block_entry(1);
		end();
	}
break;

//South of Chasm
beginstate 13;
	if(get_flag(100,2) == 0) {
		message_dialog("You stand at the edge of a deep gorge which completely cuts off all access to the small area of land to the north. From this vantage point, you see no way over there at all.","Which is odd, because you can just about make out a series of stones on the other side - there is definitely something over there...");
		set_flag(100,2,1);
	}
break;

//Near Tower
beginstate 14;	
	if(get_flag(100,3) == 0) {
		reset_dialog();
		add_dialog_str(0,"You stumble to the top of this hill, still slightly dazed after your journey to this mountain clearing, and into a wide, open space that looks like something straight out of a fairy tale.",0);
		add_dialog_str(1,"The large lilacs that thrive in the Valley are in full bloom up here, despite the tall precipices all around. At the far end, a large tower rises up, scraping the clouds with it's peak.",0);
		add_dialog_str(2,"As you take a few steps forward, you suddenly stop. The flowers are plenty, and as fragrant as ever, but even their sweet aroma cannot hide the unnerving stench of death that is carried on the breeze.",0);
		add_dialog_str(3,"You have clearly come to the _right_ place.",0);
		run_dialog(1);
		set_flag(100,3,1);
	}
break;

//See Riana
beginstate 15;
	if(get_flag(100,4) == 0) {
		message_dialog("You march on a short distance. Suddenly, you see somebody ahead. You shield your eyes and look - and see the object of your quest - Laurina. She is kneeling outside a huge tower to the west, picking flowers.","Then, she stands up, and goes inside. At last, you have found her - all you have to do now is take her back to Mayor Stone...");
		set_flag(100,4,1);
	}
break; 

//Greenleaf Greeting
beginstate 16;
	if(get_flag(100,5) == 0) {
		message_dialog("You approach the town of Greenleaf for the very first time. Despite it being a small town by Imperial standards, it is protected by a thick wooden palisade, and even has a small barracks.","The thing you notice most of all though, is how gorgeous everything is - it's unusual for the Empire to put aesthetics before practicality, and yet Greenleaf is equally as beautiful as it's surroundings.");
		set_flag(100,5,1);
	}
break;

//Sherrington
beginstate 17;
	if(get_flag(100,6) == 0) {
		message_dialog("You approach this small cluster of buildings which are collectively known as _Sherrington_. It is by far the smallest town you have ever visited, and possibly the most un-welcoming - you can see nobody at all in the area.","After a moment, somebody yells at you. You struggle to hear it but it sounded like _Get gone! We don't want anybody else to go missing, so go!_");
		message_dialog("You decide to obey their wishes, and leave.","");
		set_flag(100,6,1);
	} else {
		print_str("You return to Sherrington.");  
		print_str("The place still looks deserted.");
	} 
break;  

//Bridge
beginstate 18;
	if(get_flag(100,7) == 0) {
		message_dialog("You step onto this stone bridge, hovering only inches above the fast moving river beneath you. Turning to the west, you stand and gaze at the waterfall before you.","Gallons upon gallons of water must be pouring down at break-neck speed every second. Even from here you can hear the crashing water on the river below. It is truly awe-inspiring.");
		set_flag(100,7,1);
	}
break;

beginstate 19;//Wnadering guards typos lol
	message_dialog("You meet some soldiers on the road. They march over to you, and chat idly for a while. Eventually, they make to leave, but not before warning you against traveling in the Valley at night. You thank them, and move on.","");
	outdoor_enc_result(1);
break;
